<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>学生主页</title>
    <link rel="stylesheet" href="{{ url_for('static', filename='css/style.css') }}">
</head>
<body>
    <div class="container mt-5">
        <h1 class="text-center">欢迎，学生 {{ username }}！</h1>
        <div class="card p-4">
            <form action="/student_dashboard/{{ username }}" method="POST">
                <div class="mb-3">
                    <label for="class_name" class="form-label">输入要加入的班级名称:</label>
                    <input type="text" id="class_name" name="class_name" class="form-control" value="{{ class_name }}" required>
                </div>
                <button type="submit" class="btn btn-success w-100">加入班级</button>
            </form>
        </div>
        {% if not class_name %}
            <div class="alert alert-info text-center mt-4">
                当前没有可加入的班级。
            </div>
        {% endif %}
    </div>
</body>
</html>
